- Licensed under the GNU AGPL version 3 or higher.
-}
+{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
module Annex.Magic (
- Licensed under the GNU AGPL version 3 or higher.
-}
+{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
- Licensed under the GNU AGPL version 3 or higher.
-}
+{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
- Licensed under the GNU AGPL version 3 or higher.
-}
+{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
module Config.Files where
- License: BSD-2-clause
-}
+{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
module Utility.FreeDesktop (
- License: BSD-2-clause
-}
+{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
module Utility.OSX (
import Utility.UserInfo
autoStartBase :: String -> OsPath
-autoStartBase label = literalOsPath "Library" </> literalOsPath "LaunchAgents" </> literalOsPath (label ++ ".plist")
+autoStartBase label = literalOsPath "Library"
+ </> literalOsPath "LaunchAgents"
+ </> toOsPath label <> literalOsPath ".plist"
systemAutoStart :: String -> OsPath
systemAutoStart label = literalOsPath "/" </> autoStartBase label
toOsPath = toOsPath . toRawFilePath
fromOsPath = fromRawFilePath . fromOsPath
-{- Used for string constants. -}
-literalOsPath :: String -> OsPath
-literalOsPath = toOsPath
-
#ifdef WITH_OSPATH
instance OsPathConv RawFilePath where
toOsPath = bytesToOsPath . S.toShort
getSearchPath :: IO [OsPath]
getSearchPath = map toOsPath <$> PB.getSearchPath
+{- Used for string constants. -}
+literalOsPath :: ShortByteString -> OsPath
+literalOsPath = bytesToOsPath
+
#else
{- When not building with WITH_OSPATH, use RawFilePath.
-}
unsafeFromChar :: Char -> Word8
unsafeFromChar = fromIntegral . ord
+
+literalOsPath :: RawFilePath -> OsPath
+literalOsPath = id
#endif
- License: BSD-2-clause
-}
+{-# LANGUAGE OverloadedStrings #-}
+
module Utility.SshConfig (
SshConfig(..),
Comment(..),
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
+{-# LANGUAGE OverloadedStrings #-}
module Utility.Tmp.Dir (
withTmpDir,
- Licensed under the GNU AGPL version 3 or higher.
-}
+{-# LANGUAGE OverloadedStrings #-}
+
module Utility.Tor (
OnionPort,
OnionAddress(..),
hiddenServiceSocketFile :: AppName -> UserID -> UniqueIdent -> OsPath
hiddenServiceSocketFile appname uid ident =
varLibDir </> toOsPath appname
- </> toOsPath (show uid ++ "_" ++ ident) </> toOsPath "s"
+ </> toOsPath (show uid ++ "_" ++ ident) </> literalOsPath "s"
-- | Parse torrc, to get the socket file used for a hidden service with
-- the specified UniqueIdent.
parse [] = Nothing
parse (("HiddenServiceDir":hsdir:[]):("HiddenServicePort":_hsport:hsaddr:[]):rest)
| "unix:" `isPrefixOf` hsaddr && hasident (toOsPath hsdir) =
- Just $ toOsPath $ drop (length "unix:") hsaddr
+ Just $ toOsPath $ drop (length ("unix:" :: String)) hsaddr
| otherwise = parse rest
parse (_:rest) = parse rest